package com.wanlian.netty.File.msg.util;

import com.wanlian.json.JsonStringUtil;
import com.wanlian.netty.File.model.FileDeleteModel;
import com.wanlian.netty.File.msg.FileBaseMsg;
import com.wanlian.netty.msg.MsgType;

//删除文件
public class FileDeleteMsg extends FileBaseMsg {
    private FileDeleteModel deleteModel;

    public FileDeleteMsg(String data){
        this.setDeleteModel(JsonStringUtil.readValue(data,FileDeleteModel.class));
        this.setType(MsgType.DEVICE_FILE_DELETE_REQ);
    }

    public FileDeleteModel getDeleteModel() {
        return deleteModel;
    }

    public void setDeleteModel(FileDeleteModel deleteModel) {
        this.deleteModel = deleteModel;
        this.getBaseHead().setTagClientId(deleteModel.getDeviceKey());
        this.setContent(JsonStringUtil.writeValueAsString(this.deleteModel));
    }
}
